#include "stdafx.h"
#include "detail/bmock_exp_checker.hpp"
#include "detail/bmock_message.hpp"

namespace bmock {
	void exp_checker::check_func(const func_spec &fd1,const func_spec &fd2,const arg_list &args) const {
		if (fd1 == fd2) return;
		tools_->error(fd2.message(args),loc_,true);
	}

	bool exp_checker::check_func_no_throw(const func_spec &fd1,const func_spec &fd2) const
	{
		return (fd1 == fd2);
	}

	void exp_checker::not_received(const func_spec &func, int exp_times, int actual_times) const {
		std::stringstream s;
		s << " (expected: " << exp_times << ", actual: " << actual_times << ")";
		tools_->error(message(NOT_RECEIVED,func.name(),s.str()),loc_);
	}

	void exp_checker::fail() const {
		throw loc_;
	}
}